<script setup>
import HelloWorld from '@/components/HelloWorld.vue'
// import { ref,defineProps,defineEmits,onMounted,onUnmounted } from 'vue'
// import { ElMessage } from 'element-plus'
onMounted(() => {
  console.log('我挂载好了')
})
onBeforeMount(() => {
  console.log('挂载前干点啥')
})
onBeforeUnmount(() => {
  console.log('卸载前干点啥')
})
onUnmounted(() => {
  console.log('我卸载了')
})
const count = ref(0)

watch(
  () => count.value,
  (val) => {
    console.log('count变化了', val)
  }
)

const props = defineProps({ id: Number })
const emits = defineEmits(['click'])
function clickBtn() {
  ElMessage.warning('弹弹弹')
  count.value++
}

const useB = () => {
  // count.value = getB()
}

// const obj = {
//   a: 2,
//   a: [1, 3, 3],
//   b: '5'
// }

const getB = () => 3

// function getA() {
//   return a
// }

// function getB() {
//   return '3'
// }
</script>

<template>
  <div>
    <div>
      按钮弹出msg<el-button type="primary" @click="clickBtn">{{ count }}</el-button>
    </div>
    <a href="#" target="_blank">
      <img src="/vite.svg" class="logo" alt="Vite logo" />
    </a>
    <a href="#" target="_blank">
      <img src="./assets/vue.svg" class="logo vue" alt="Vue logo" />
    </a>
  </div>
  <HelloWorld msg="Vite + Vue" />
</template>

<style scoped>
.logo {
  height: 6em;
  padding: 1.5em;
  will-change: filter;
  transition: filter 300ms;
}
.logo:hover {
  filter: drop-shadow(0 0 2em #646cffaa);
}
.logo.vue:hover {
  filter: drop-shadow(0 0 2em #42b883aa);
}
</style>
